package xyz.xtt.asset.vo;

import java.time.LocalDateTime;

import cn.hutool.core.util.IdUtil;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import xyz.xtt.asset.entity.TblArtAmberCard;

/**
 * 盲盒第三方响应
 * 
 * @author huqibo
 * @date 2025/01/19
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MystryBoxItem {
	// 图片
	private String profileImg;
	// 级别
	private String rarityType;
	// 卡号
	private String cardNo;

	public TblArtAmberCard convert(Long amberOrderId, Long appUid) {
		return TblArtAmberCard
				.builder()
				.id(IdUtil.getSnowflakeNextId())
				.appUserId(appUid)
				.amberOrderId(amberOrderId)
				.profileImg(profileImg)
				.rarityType(rarityType)
				.cardNo(cardNo)
				.crt(LocalDateTime.now())
				.build();
	}
}
